# -*- coding: utf-8 -*-
# @Time    : 2019/2/22 15:52
# @Author  : yueconger
# @File    : demo.py
import re

html_path = r'C:\Users\xizhi\Desktop\刑事_分页.html'
with open(html_path, 'r', encoding='utf-8') as f:
    content = f.read()

pattern = '下页.*?href=".*?index_(\d+).html">尾页'
res = re.findall(pattern, content)
if len(res) > 0:
    # 找到尾页号,从而构造下一页
    print('当前模块共%s页'%(res[0]))
